package com.immunology.service.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.immunology.dao.UserDao;
import com.immunology.domain.Role;
import com.immunology.domain.User;
import com.immunology.exception.DaoException;
import com.immunology.service.UserService;

@Service
public class UserServiceImpl implements UserService{

	@Autowired
	private UserDao userDao;

	@Override
	public User findById(Long id) throws DaoException {
		return userDao.findById(id);
	}

	@Override
	public List<User> getAll() throws DaoException {
		return userDao.getAll();
	}

	@Override
	public void saveOrUpdate(Collection<User> entities) throws DaoException {
		userDao.saveOrUpdate(entities);
	}

	@Override
	public void saveOrUpdate(User... entities) throws DaoException {
		userDao.saveOrUpdate(entities);
	}

	@Override
	public void update(Collection<User> entities) throws DaoException {
		userDao.update(entities);
	}

	@Override
	public void update(User... entities) throws DaoException {
		userDao.update(entities);
	}

	@Override
	public void delete(Collection<User> entities) throws DaoException {
		userDao.delete(entities);
	}

	@Override
	public void delete(User... entities) throws DaoException {
		userDao.delete(entities);
	}
	
	@Override
	public void deleteAll() throws DaoException {
		userDao.deleteAll();
	}

	@Override
	public User getByLogin(String login) {
		return userDao.getByLogin(login);
	}

	@Override
	public void save(Collection<User> entities) throws DaoException {
		userDao.save(entities);
	}

	@Override
	public void save(User... entities) throws DaoException {
		userDao.save(entities);
	}
}
